<template>
  <common_print_dialog ref="common_print_dialog" businessType="RETURN_SKU" v-bind="$attrs" v-on="$listeners" :tableModel="[
    {
      key: 'skuName', label: 'label_sku_name', formType: 'text', formatter: (r, c, v) => this.$formatNameCode(v, r.skuNameEn),
    },
    { key: 'skuOnlyCode', label: 'label_sku_only_code', formType: 'text', },
    { key: 'returnSkuCodeList', label: 'label_return_order_sku_code', formType: 'text',formatter: (r, c, v) => v?v.join(','):'' },
  ]" printUrl="/wms-api/refund/WmsReturnOrderRpc/pushReturnSkuCode.json" :printHandler="(data, list) => {
    data.clientId =data.clientName
    data.printNum =data.printNumSum
    data.returnSkuCodes = list.map(it => it.returnSkuCodeList)
  return data
}" previewUrl="/wms-api/refund/WmsReturnOrderRpc/previewReturnSkuCode.json" :previewHandler="(data, row) => {
  data.returnSkuCodeList = row.returnSkuCodeList?row.returnSkuCodeList.join(','):'';
  return data
}" />
</template>

<script>
import common_print_dialog from './common_print_dialog.vue'
export default {
  components: { common_print_dialog },
  data() {
    return {
    }
  },
  props: {
  },
  methods: {
    show(rows) {
      this.$refs.common_print_dialog.show(rows)
    },
  }
}
</script>
